<?php
include './source/class/class_core.php';
?>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>用户消费明细</title>
	<link rel="stylesheet" href="images/global.min.css">
</head>
<body id="history">

<table>
	<tr>
		<td>时间</td>
		<td>单</td>
	</tr>
	<?php 
	$user_id = $_GET['user_id'];
	$source = DB::query("SELECT order_info_ext, order_time FROM `om_order` where user_id = $user_id");
	while ($row = DB::fetch($source)){
	?>
	
	
	<tr>
		<td><?=date('Y-m-d H:i', $row['order_time'])?></td>
		<td>
			<table>
				<tr>
					<?php 
					foreach(unserialize($row['order_info_ext']) as $val){
						echo '<td>'.$val['name'].'</td>';
						echo '<td>￥'.$val['price'].'</td>';
						echo '<td>'.$val['num'].'份</td>';
						echo '</tr><tr>';
					}
					?>
				</tr>
			</table>
		</td>
	</tr>
	<?php
	}
	?>
</table>